#include "SList.h"

void TestSList1(){
    SLTNode * Plist= NULL;
    SListPushBack(&Plist,3);
    SListPushBack(&Plist,4);
    SListPushFront(&Plist,5);
    SListPushFront(&Plist,5);
    SListPushBack(&Plist,10);
    SListPrint(Plist);
    SListPopFront(&Plist);
    SListPopFront(&Plist);
    SListPrint(Plist);
    SListPopBack(&Plist);
    SListPrint(Plist);
}
void TestSList2(){
    SLTNode * Plist= NULL;
    SListPushBack(&Plist,3);
    SListPushBack(&Plist,4);
    SListPushFront(&Plist,5);
    SListPushFront(&Plist,6);
    SListPushBack(&Plist,10);
    SListPrint(Plist);
    SLTNode* pos= SListFind(Plist,3);
    if (pos){
        SListInsert(&Plist,pos,30);
    }
    pos= SListFind(Plist,6);
    if (pos){
        SListInsert(&Plist,pos,20);
    }
    SListPrint(Plist);

}
void TestSList3(){
    SLTNode * Plist= NULL;
    SListPushBack(&Plist,3);
    SListPushBack(&Plist,4);
    SListPushFront(&Plist,5);
    SListPushFront(&Plist,6);
    SListPushBack(&Plist,10);
    SListPrint(Plist);
    SLTNode* pos= SListFind(Plist,10);
    if (pos){
        SListErase(&Plist,pos);
    }
    pos= SListFind(Plist,6);
    if (pos){
        SListErase(&Plist,pos);
    }
    SListPrint(Plist);

}
#define f(a,b,x)a*x+b
int main() {
    printf("%d,%d\n",f(3,2,1),f(6,5,f(3,2,1)));
    return 0;
}
